home *** CD-ROM | disk | FTP | other *** search
- Path: castle.nando.net!news
- From: actuary@nando.net (Bill McCarthy)
- Newsgroups: comp.lang.c
- Subject: Re: random number
- Date: 4 Feb 1996 03:41:51 GMT
- Organization: News & Observer Public Access
- Message-ID: <4f19tv$i28@castle.nando.net>
- References: <1996Feb4.020051.12889@dcs.warwick.ac.uk>
- Reply-To: actuary@nando.net (Bill McCarthy)
- NNTP-Posting-Host: grail802.nando.net
- X-Newsreader: IBM NewsReader/2 v1.2
-
- In <1996Feb4.020051.12889@dcs.warwick.ac.uk>, D.C.Molero@dcs.warwick.ac.uk (Daniel Castillo Molero) writes:
- >Hi,
- >Could anybody help me to generate some code to produce
- >a random number between -3 and 3 ?
- >I'm trying to use rand(), but since it doesn't receive
- >any argument, I cannot specify the range. Probably one
- >way would be to access the constant RAND_MAX, but I don't know
- >how to do this, since I'm new in c.
- >Any help will be grately appreciated.
-
- Just grep the FAQ for rand and you'll see how it's done.
-
- Bill McCarthy
- actuary@nando.net
- Wendell, NC USA
-
-